package day04;

import java.util.Scanner;

public class ExtraPractice {
    public static void main(String[] args) {
        /*Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个数,我来判断是否为正数负数和0");
        int num = scan.nextInt();
        if (num>0){
            System.out.println("+");
            System.out.println("是正数");
        }else if (num<0){
            System.out.println("-");
            System.out.println("是负数");
        }
        else {
            System.out.println("0");
        }
*///判断正负数和0

       /* Scanner scan = new Scanner(System.in);
        System.out.println("请输入年份和月份,我来判断该年该月的天数");
        int year = scan.nextInt();
        int month = scan.nextInt();
        if (month > 0 && month <= 12){
            if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {//判断是否为闰年
                if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {

                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有31天");

                } else if (month == 4 || month == 6 || month == 9 || month == 11) {

                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有30天");
                } else {
                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有29天");
                }
            } else {
                if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {

                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有31天");

                } else if (month == 4 || month == 6 || month == 9 || month == 11) {

                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有30天");
                } else {
                    System.out.println("你输入的年份是" + year + "你输入的月份是" + month + "此月份有28天");
                }
            }
        }else {
            System.out.println("输入月份有误");
        }*///接收用户输入的年份year和月份month，计算该年该月的天数，并输出

       /* int i = 0;
        int sum = 0;
        while (true){
            if (i>100){
                break;
            }
            sum += i;
            i++;
        }
        System.out.println(sum);*///用while计算1-100的和
        /*int times = 0;
        for (int year = 1900; year <= 2023; year++) {
            if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
                System.out.print(year + " ");
                times++;
                if (times % 10 == 0) {
                    System.out.println();
                }
*/

            }

        }




